﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.Web.Routing;
using StructureMap;

namespace BonsaiScrum.Mvc
{
    public class StructureMapControllerFactory : DefaultControllerFactory
    {
        protected override IController GetControllerInstance(RequestContext requestContext, Type controllerType)
        {
            Controller controller = null;

            if (controllerType != null)
                controller = ObjectFactory.GetInstance(controllerType) as Controller;

            return controller;
        }
    }
}
